import java.util.List;

public interface PaperSelectionStrategy {
    List<Paper> selectPapers(List<Paper> availablePapers, int quantity);
}
import java.util.Collections;
import java.util.List;

public class RandomSelectionStrategy implements PaperSelectionStrategy {
    @Override
    public List<Paper> selectPapers(List<Paper> availablePapers, int quantity) {
        if (quantity < 0 || quantity > availablePapers.size()) {
            throw new IllegalArgumentException("选择数量无效");
        }
        List<Paper> copy = new java.util.ArrayList<>(availablePapers);
        Collections.shuffle(copy);
        return copy.subList(0, quantity);
    }
}
import java.util.List;

public class FIFOSelectionStrategy implements PaperSelectionStrategy {
    @Override
    public List<Paper> selectPapers(List<Paper> availablePapers, int quantity) {
        if (quantity < 0 || quantity > availablePapers.size()) {
            throw new IllegalArgumentException("选择数量无效");
        }
        return availablePapers.subList(0, quantity);
    }
}